var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = (function () {
    function e() {
        (this.SW_SystemBanner = !1),
            (this.SW_SystemInters = !1),
            (this.SW_Video = !1),
            (this.SW_Native = !1),
            (this.SW_NativeBanner = !1),
            (this.SW_NativeInters = !1),
            (this.SW_Box = !1),
            (this.SW_Block = !1),
            (this.SW_BigNative = !1),
            (this.SW_IconNative = !1),
            (this.ID_SystemBanner = ""),
            (this.ID_SystemInters = ""),
            (this.ID_Native = ""),
            (this.ID_NativeCustom = ""),
            (this.ID_Video = ""),
            (this.ID_Box = ""),
            (this.ID_Block = ""),
            (this.NUM_NativeIntersP = 0),
            (this.NUM_NativeIntersReport = 1),
            (this.NUM_BannerErrP = 0),
            (this.NUM_BannerErrMost = 0),
            (this.NUM_BannerErrMust = 0),
            (this.NUM_VideoErrP = 0),
            (this.NUM_VideoErrMost = 0),
            (this.NUM_VideoErrMust = 0),
            (this.NUM_BannerUpdateTime = 30),
            (this.SW_SystemBannerFirst = !0),
            (this.NUM_BannerMostShow = 99),
            (this.SW_IntersBaseControl = !1),
            (this.NUM_IntersStart = 0),
            (this.NUM_IntersIntervalNum = 0),
            (this.NUM_IntersIntervalTime = 0),
            (this.NUM_IntersDelayTime = 0),
            (this.NUM_IntersDelayP = 0),
            (this.NUM_NativeUpdateTime = 30),
            (this.SW_AddDesktop = !1),
            (this.SW_IntersIntervalToAddDesktop = !1),
            (this.NUM_AutoAddDeskMostTimes = 0),
            (this.NUM_IntersToAddDesktopNumber = 0),
            (this.SW_Statistics = !0),
            (this.SW_NavigateIcon = !1),
            (this.SW_NavigateGroup = !1),
            (this.SW_NavigateSettle = !1),
            (this.pushGameList = []),
            (this.bannerAd = null),
            (this.loadSucc_Banner = !1),
            (this.loadSucc_SystemBanner = !1),
            (this.loadSucc_NativeBanner = !1),
            (this.hasShowBanner = !1),
            (this.isShow_SystemBanner = !1),
            (this.isShow_NativeBanner = !1),
            (this.interval_updateBanner = null),
            (this.timeout_checkBannerLoadSucc = null),
            (this.NUM_CheckBannerLoadSucc = 0),
            (this.NUM_MaxCheckBannerLoadSucc = 5),
            (this.NUM_BannerClose = 0),
            (this.timeout_showSystemBanner = null),
            (this.systemIntersAd = null),
            (this.loadSucc_SystemInters = !1),
            (this.NUM_SystemIntersLoadError = 0),
            (this.videoAd = null),
            (this.loadSucc_Video = !1),
            (this.callback_Video = null),
            (this.timeout_loadVideo = null),
            (this.nativeAd = null),
            (this.customNativeAd = null),
            (this.loadSucc_NativeIcon = !1),
            (this.isShow_NativeIcon = !1),
            (this.isShow_NativeImage = !1),
            (this.loadSucc_NativeImage = !1),
            (this.nativeAdInfo = null),
            (this.firstNativeAdInfo = null),
            (this.customNativeAdInfo = null),
            (this.param_nativeIcon = null),
            (this.timeout_updateNativeIcon = null),
            (this.timeout_updateNativeImage = null),
            (this.node_nativeIcon = null),
            (this.node_nativeImage = null),
            (this.customNativeAdIdArray = [""]),
            (this.nativeOtherRes = null),
            (this.loadSucc_NativeOther = !1),
            (this.nativeBannerRes = null),
            (this.node_nativeBanner = null),
            (this.nativeIntersRes = null),
            (this.loadSucc_NativeInters = !1),
            (this.node_nativeInters = null),
            (this.NUM_hasShowInters = 0),
            (this.NUM_intersNowInterval = 0),
            (this.NUM_IntersNowIntervalTime = 0),
            (this.NUM_IntersNowToAddDesktop = 0),
            (this.AdGroup = ""),
            (this.UcSysInfo = null);
    }
    return (
        (e.prototype.getGameTestVersion = function () {
            return !1;
        }),
        (e.prototype.createAd = function () {
            console.log("=====UC===创建广告=====");
            var e = this;
            uc.getSystemInfo({
                success: function (t) {
                    console.log("====uc==createInterstitialAd====res====", t), (e.UcSysInfo = t), e.UcCreateAdInfo();
                },
                fail: function (e) {
                    console.log("====uc==createInterstitialAd====err====", e), console.error(e);
                }
            });
        }),
        (e.prototype.UcCreateAdInfo = function () {
            this.SW_SystemBanner && this.createSystemBanner(),
                this.SW_SystemInters && this.createSystemInters(),
                this.NUM_IntersIntervalTime > 0 && this.runIntersInterval(),
                this.SW_Video && this.createVideo();
        }),
        (e.prototype.startLoadPushGamaes = function () {}),
        (e.prototype.createSystemBanner = function () {
            var e = this,
                t =
                    (this.UcSysInfo.screenWidth > this.UcSysInfo.screenHeight
                        ? this.UcSysInfo.screenHeight
                        : this.UcSysInfo.screenWidth) / 2,
                o = {width: t, height: (194 * t) / 345, gravity: 7};
            (this.bannerAd = uc.createBannerAd({style: o})),
                this.bannerAd.onLoad(function () {
                    (e.loadSucc_SystemBanner = !0), console.log("ChaoQiGameSDK", "UC 系统banner加载成功");
                }),
                this.bannerAd.onError(function (t) {
                    console.log("ChaoQiGameSDK", "UC 系统banner加载失败：", JSON.stringify(t)),
                        (e.bannerAd = null),
                        (e.loadSucc_SystemBanner = !1);
                });
        }),
        (e.prototype.createSystemInters = function () {
            var e = this;
            this.loadSucc_SystemInters ||
                (console.log("ChaoQiGameSDK", "--createSystemInters--"),
                (this.systemIntersAd = uc.createInterstitialAd()),
                this.systemIntersAd
                    .load()
                    .then()
                    .catch(function (e) {
                        return console.log(e);
                    }),
                this.systemIntersAd.onLoad(function () {
                    console.log("ChaoQiGameSDK", "UC 系统插屏广告加载完成"), (e.loadSucc_SystemInters = !0);
                }),
                this.systemIntersAd.onError(function (t) {
                    e.NUM_SystemIntersLoadError++,
                        (e.loadSucc_SystemInters = !1),
                        console.log(
                            "ChaoQiGameSDK",
                            e.NUM_SystemIntersLoadError,
                            "UC 系统插屏加载失败：",
                            JSON.stringify(t)
                        ),
                        e.NUM_SystemIntersLoadError < 5 &&
                            setTimeout(function () {
                                e.createSystemInters();
                            }, 1e4);
                }),
                this.systemIntersAd.onClose(function () {
                    console.log("ChaoQiGameSDK", "UC 系统插屏广告关闭"),
                        (e.NUM_IntersNowIntervalTime = 0),
                        (e.loadSucc_SystemInters = !1),
                        setTimeout(function () {
                            e.createSystemInters();
                        }, 1e4);
                }));
        }),
        (e.prototype.createVideo = function () {
            var e = this;
            console.log("===UC====ChaoQiGameSDK", "--createVideo--"),
                (this.videoAd = uc.createRewardVideoAd()),
                this.videoAd.onLoad(function () {
                    console.log("ChaoQiGameSDK", "UC 视频广告加载完成"), (e.loadSucc_Video = !0);
                }),
                this.videoAd.onError(function (t) {
                    console.log("ChaoQiGameSDK", "UC 视频加载失败：", JSON.stringify(t)),
                        (e.loadSucc_Video = !1),
                        setTimeout(function () {
                            e.videoAd && e.videoAd.load();
                        }, 3e3);
                }),
                this.videoAd.onClose(function (t) {
                    t && t.isEnded
                        ? (console.log("ChaoQiGameSDK", "UC 激励视频广告完成，发放奖励"),
                          e.callback_Video && (e.callback_Video(!0), (e.callback_Video = null)))
                        : (console.log("ChaoQiGameSDK", "UC 激励视频广告取消关闭，不发放奖励"),
                          e.callback_Video && (e.callback_Video(!1), (e.callback_Video = null))),
                        (e.loadSucc_Video = !1),
                        setTimeout(function () {
                            e.videoAd && e.videoAd.load();
                        }, 3e3);
                });
        }),
        (e.prototype.createNative = function () {}),
        (e.prototype.createCustomNative = function () {}),
        (e.prototype.loadNativeBannerRes = function () {}),
        (e.prototype.loadNativeInterRes = function () {}),
        (e.prototype.loadNativeOtherRes = function () {}),
        (e.prototype.showBanner = function () {
            if (this.loadSucc_Banner)
                return this.NUM_BannerMostShow <= this.NUM_BannerClose
                    ? (console.log("ChaoQiGameSDK", "banner最大关闭次数", this.NUM_BannerMostShow, " 已达上限 return"),
                      void (this.interval_updateBanner && clearInterval(this.interval_updateBanner)))
                    : void (this.hasShowBanner
                          ? console.log("ChaoQiGameSDK", "已经调用过showBanner,请勿重复调用")
                          : ((this.hasShowBanner = !0), this.showSystemBanner(), this.updateBanner()));
            this.checkBannerLoadSucc();
        }),
        (e.prototype.hideBanner = function () {
            (this.hasShowBanner = !1),
                this.hideNativeBanner(),
                this.hideSystemBanner(),
                this.interval_updateBanner && clearInterval(this.interval_updateBanner),
                this.timeout_showSystemBanner && clearTimeout(this.timeout_showSystemBanner),
                this.timeout_checkBannerLoadSucc && clearTimeout(this.timeout_checkBannerLoadSucc);
        }),
        (e.prototype.getIntersFlag = function () {
            return !0;
        }),
        (e.prototype.showInters = function () {
            var e = this;
            (this.NUM_intersNowInterval = 0),
                console.log("ChaoQiGameSDK", "改为展示系统插屏"),
                this.NUM_IntersDelayTime > 0 && Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                    ? (console.log("ChaoQiGameSDK", "插屏延迟时间(ms):" + this.NUM_IntersDelayTime),
                      setTimeout(function () {
                          e.showSystemInters();
                      }, this.NUM_IntersDelayTime))
                    : this.showSystemInters();
        }),
        (e.prototype.getVideoFlag = function () {
            return this.loadSucc_Video;
        }),
        (e.prototype.showVideo = function (e) {
            var t = this;
            this.videoAd &&
                this.loadSucc_Video &&
                (console.log("ChaoQiGameSDK", "UC showVideo==========================="),
                (this.callback_Video = e),
                this.videoAd.show().catch(function () {
                    t.videoAd
                        .load()
                        .then(function () {
                            t.videoAd.show();
                        })
                        .catch(function (e) {
                            console.log(e), e();
                        });
                }));
        }),
        (e.prototype.getNativeIconFlag = function () {
            return this.loadSucc_NativeOther && this.loadSucc_NativeIcon;
        }),
        (e.prototype.showNativeIcon = function () {}),
        (e.prototype.hideNativeIcon = function () {}),
        (e.prototype.getNativeImageFlag = function () {
            return this.loadSucc_NativeOther && this.loadSucc_NativeImage;
        }),
        (e.prototype.showNativeImage = function () {}),
        (e.prototype.hideNativeImage = function () {
            (this.isShow_NativeImage = !1),
                this.node_nativeImage &&
                    (console.log("ChaoQiGameSDK", "UC hideNativeImage==========================="),
                    this.node_nativeImage.removeFromParent(),
                    (this.node_nativeImage = null));
        }),
        (e.prototype.getNativeAdFlag = function () {
            return !1;
        }),
        (e.prototype.getNativeAdInfo = function (e) {
            return 1 == e
                ? (console.log("ChaoQiGameSDK", "获取原生广告"), this.firstNativeAdInfo)
                : (console.log("ChaoQiGameSDK", "获取自定义原生广告"), this.customNativeAdInfo);
        }),
        (e.prototype.reportNativeAdShow = function (e) {
            -1 != this.customNativeAdIdArray.indexOf(e)
                ? (console.log("ChaoQiGameSDK", "UC 自定义原生广告上报展示", e),
                  this.customNativeAd.reportAdShow({adId: e}))
                : (console.log("ChaoQiGameSDK", "UC 原生广告上报展示", e), this.nativeAd.reportAdShow({adId: e}));
        }),
        (e.prototype.reportNativeAdClick = function (e) {
            -1 != this.customNativeAdIdArray.indexOf(e)
                ? (console.log("ChaoQiGameSDK", "UC 自定义原生广告上报点击", e),
                  this.customNativeAd.reportAdShow({adId: e}))
                : (console.log("ChaoQiGameSDK", "UC 原生广告上报点击", e), this.nativeAd.reportAdClick({adId: e}));
        }),
        (e.prototype.getNavigateIconFlag = function () {
            return !1;
        }),
        (e.prototype.showNavigateIcon = function () {}),
        (e.prototype.hideNavigateIcon = function () {}),
        (e.prototype.getNavigateGroupFlag = function () {
            return !1;
        }),
        (e.prototype.showNavigateGroup = function () {}),
        (e.prototype.hideNavigateGroup = function () {}),
        (e.prototype.getNavigateSettleFlag = function () {
            return !1;
        }),
        (e.prototype.showNavigateSettle = function () {}),
        (e.prototype.hideNavigateSettle = function () {}),
        (e.prototype.getNavigateBoxBannerFlag = function () {
            return !1;
        }),
        (e.prototype.showNavigateBoxBanner = function () {}),
        (e.prototype.hideNavigateBoxBanner = function () {}),
        (e.prototype.getNavigateBoxPortalFlag = function () {
            return !1;
        }),
        (e.prototype.showNavigateBoxPortal = function () {}),
        (e.prototype.setGroup = function (e) {
            this.AdGroup = e;
        }),
        (e.prototype.hasAddDesktopFunc = function () {
            return !0;
        }),
        (e.prototype.getAddDesktopFlag = function (e) {
            e(!1);
        }),
        (e.prototype.addDesktop = function () {}),
        (e.prototype.phoneVibrate = function () {}),
        (e.prototype.startGameVideo = function () {}),
        (e.prototype.pauseGameVideo = function () {}),
        (e.prototype.resumeGameVideo = function () {}),
        (e.prototype.stopGameVideo = function () {}),
        (e.prototype.shareVideo = function () {}),
        (e.prototype.jumpToMoreGamesCenter = function () {}),
        (e.prototype.showMoreGamesBanner = function () {}),
        (e.prototype.hideMoreGamesBanner = function () {}),
        (e.prototype.showFavoriteGuide = function () {}),
        (e.prototype.getBoxFlag = function () {
            return !1;
        }),
        (e.prototype.showAppBox = function () {}),
        (e.prototype.getBlockFlag = function () {
            return !1;
        }),
        (e.prototype.showBlock = function () {}),
        (e.prototype.hideBlock = function () {}),
        (e.prototype.getVideoIntersFlag = function () {
            return !1;
        }),
        (e.prototype.showVideoInters = function () {}),
        (e.prototype.exitTheGame = function () {}),
        (e.prototype.reportAnalytics = function () {}),
        (e.prototype.showAuthentication = function () {}),
        (e.prototype.visitorExperience = function () {}),
        (e.prototype.showNativeAd = function () {}),
        (e.prototype.getOPPOShowMoreGameFlag = function () {
            return !1;
        }),
        (e.prototype.showOPPOMoreGame = function () {}),
        (e.prototype.hasNetwork = function () {}),
        (e.prototype.showReviewAlert = function () {}),
        (e.prototype.showiOSADWithScene = function () {}),
        (e.prototype.showiOSADWithType = function () {}),
        (e.prototype.videoUIShow = function () {}),
        (e.prototype.showPrivacyAgreement = function () {}),
        (e.prototype.getErrBannerFlag = function () {
            return !1;
        }),
        (e.prototype.showErrBanner = function (e) {
            e(!1);
        }),
        (e.prototype.hideErrBanner = function () {}),
        (e.prototype.getErrVideoFlag = function () {
            return !1;
        }),
        (e.prototype.buyProps = function (e, t, o, n) {
            n(!1, "");
        }),
        (e.prototype.payComplete = function () {}),
        (e.prototype.checkBannerLoadSucc = function () {
            var e = this;
            if (
                ((this.loadSucc_Banner =
                    (this.loadSucc_NativeBanner && (this.loadSucc_NativeIcon || this.loadSucc_NativeImage)) ||
                    this.loadSucc_SystemBanner),
                console.log("ChaoQiGameSDK", "banner加载成功?", this.loadSucc_Banner, ++this.NUM_CheckBannerLoadSucc),
                this.timeout_checkBannerLoadSucc && clearTimeout(this.timeout_checkBannerLoadSucc),
                this.loadSucc_Banner)
            )
                this.showBanner();
            else {
                if (this.NUM_CheckBannerLoadSucc >= this.NUM_MaxCheckBannerLoadSucc) return;
                this.timeout_checkBannerLoadSucc = setTimeout(function () {
                    e.checkBannerLoadSucc();
                }, 5e3);
            }
        }),
        (e.prototype.showNativeBanner = function () {}),
        (e.prototype.showSystemBanner = function () {
            var e = this;
            this.bannerAd && this.UcSysInfo
                ? (console.log("ChaoQiGameSDK", "UC showSystemBanner========================"),
                  (this.isShow_SystemBanner = !0),
                  this.bannerAd.show())
                : (this.createSystemBanner(),
                  (this.timeout_showSystemBanner = setTimeout(function () {
                      e.bannerAd && e.showSystemBanner();
                  }, 1e3)));
        }),
        (e.prototype.updateBanner = function () {
            var e = this;
            if (this.NUM_BannerMostShow <= this.NUM_BannerClose)
                return (
                    console.log(
                        "ChaoQiGameSDK",
                        "banner最大关闭(最多展示)次数",
                        this.NUM_BannerMostShow,
                        " 已达上限 return"
                    ),
                    void (this.interval_updateBanner && clearInterval(this.interval_updateBanner))
                );
            this.interval_updateBanner && clearInterval(this.interval_updateBanner),
                (this.interval_updateBanner = setInterval(function () {
                    if (e.NUM_BannerMostShow <= e.NUM_BannerClose)
                        return (
                            console.log(
                                "ChaoQiGameSDK",
                                "banner最大关闭(最多展示)次数",
                                e.NUM_BannerMostShow,
                                " 已达上限 return"
                            ),
                            void (e.interval_updateBanner && clearInterval(e.interval_updateBanner))
                        );
                    e.updateSystemBanner();
                }, 1e3 * this.NUM_BannerUpdateTime));
        }),
        (e.prototype.updateSystemBanner = function () {
            var e = this;
            console.log("ChaoQiGameSDK", "UC updateSystemBanner========================"),
                this.hideNativeBanner(),
                this.hideSystemBanner(),
                this.createSystemBanner(),
                (this.timeout_showSystemBanner = setTimeout(function () {
                    e.bannerAd && e.showSystemBanner();
                }, 1e3));
        }),
        (e.prototype.hideSystemBanner = function () {
            this.isShow_SystemBanner &&
                this.bannerAd &&
                (console.log("ChaoQiGameSDK", "UC hideSystemBanner========================"),
                (this.isShow_SystemBanner = !1),
                this.bannerAd.destroy());
        }),
        (e.prototype.updateNativeBanner = function () {
            console.log("ChaoQiGameSDK", "UC updateNativeBanner========================"),
                this.hideNativeBanner(),
                this.hideSystemBanner(),
                this.showNativeBanner();
        }),
        (e.prototype.hideNativeBanner = function () {
            (this.isShow_NativeBanner = !1),
                this.node_nativeBanner &&
                    (console.log("ChaoQiGameSDK", "UC hideNativeBanner========================"),
                    this.node_nativeBanner.removeFromParent(),
                    (this.node_nativeBanner = null));
        }),
        (e.prototype.showSystemInters = function () {
            if (this.systemIntersAd) {
                if (
                    (console.log("ChaoQiGameSDK", "UC showSystemInters=================="),
                    !this.UcSysInfo || this.UcSysInfo.SDKVersion < "1.1.2")
                )
                    return;
                this.systemIntersAd &&
                    this.systemIntersAd
                        .show()
                        .then(function () {
                            console.log("ChaoQiGameSDK", "UC 系统插屏广告展示成功==================");
                        })
                        .catch(function (e) {
                            console.log("ChaoQiGameSDK", "UC 系统插屏展示错误:" + JSON.stringify(e));
                        });
            }
        }),
        (e.prototype.showNativeInters = function () {}),
        (e.prototype.nativeAdAutoUpdate = function () {
            var e = this;
            setInterval(function () {
                e.nativeAd && e.nativeAd.load();
            }, 1e3 * this.NUM_NativeUpdateTime);
        }),
        (e.prototype.customNativeAdAutoUpdate = function () {
            var e = this;
            setInterval(function () {
                e.customNativeAd && e.customNativeAd.load();
            }, 1e3 * this.NUM_NativeUpdateTime);
        }),
        (e.prototype.runIntersInterval = function () {
            var e = this;
            this.NUM_IntersIntervalTime > 0 &&
                setInterval(function () {
                    e.NUM_IntersNowIntervalTime++;
                }, 1e3);
        }),
        e
    );
})();
o.default = n;
